Delete Last Messages Endpoint
Overview
This endpoint deletes the last message exchange (user and assistant messages) from a chat conversation. It also handles cleanup of any trailing user messages.
Request Details
HTTP Method
DELETE
Route
/api/users/[user_id]/chats/[chat_id]/messages/last
Route Parameters
Parameter | Type | Required | Description |
---|---|---|---|
user_id | integer | Yes | Unique identifier of the user |
chat_id | integer | Yes | Unique identifier of the chat |
Headers
Header | Value | Required | Description |
---|---|---|---|
Cookie | neptun-session | Yes | Session authentication cookie |
Query Parameters
No query parameters required.
Request Body
No request body required.
Response Format
Response Status Codes
Status Code | Description |
---|---|
200 | Messages successfully deleted |
400 | No messages found in chat |
401 | Unauthorized (invalid or missing session) |
404 | Chat or user not found |
500 | Server error |